#ifndef H_COLLISION
#define H_COLLISION

#include "geometry.h"

struct Collision;

Collision *
Collision_Instance(void);

void
Collision_Init(Collision *self);

void
Collision_Update(Collision *self);

void
Collision_Term(Collision *self);

enum CollisionType {
    CT_None,
    CT_Player,
    CT_Brick,
    CT_Kuribou,

    CT_NUM
};

/** @return collisionId */
int
Collision_Register(Collision *self, const XY &pos, const WH &wh, CollisionType t);

int
Collision_RegisterS(Collision *self, float px, float py, float w, float h, CollisionType t);

void
Collision_Unregister(Collision *self, int collisionId);

enum CollisionResultType {
    CR_NotCollided,
    CR_Bounced,
    CR_Lose,
    CR_Win,

    CR_NUM
};
const wchar_t *
CollisionResultTypeToStr(CollisionResultType t);

void
Collision_Move(Collision *self, int collisionId, const XY &vWant);

void
Collision_MoveS(Collision *self, int collisionId, float vWantX, float vWantY);

float
Collision_ResultGetPosLeftX(Collision *self, int collisionId);

float
Collision_ResultGetPosBottomY(Collision *self, int collisionId);

CollisionResultType
Collision_ResultGetResultType(Collision *self, int collisionId);

float
Collision_ResultGetVX(Collision *self, int collisionId);

float
Collision_ResultGetVY(Collision *self, int collisionId);

bool
Collision_ResultIsLanded(Collision *self, int collisionId);

#endif /* H_COLLISION */
